import javax.swing.ImageIcon;


public class Card implements Comparable<Card> {
	
    private final Suit suit;
    private final Face face;
    private ImageIcon cardImage;
 
    public Card(Face face, Suit suit) {
        this.face = face;
        this.suit = suit;
    }
    
    public Card(Face face, Suit suit, ImageIcon cardImage) {
    	this.cardImage = cardImage;
    	this.face = face;
    	this.suit = suit;
    }
    
    public ImageIcon getCardImage() {
    	return cardImage;
    }
 
    public Face face() {
        return face;
    }
 
    public Suit suit() {
        return suit;
    }
    
    public int value() {
    	return face.value();
    }
 
    @Override
    public String toString() {
        return face + " of " + suit;
    }

	@Override
	public int compareTo(Card otherCard) {
		// Pre: otherCard is non-null and of type Card
		// Post: returns <, ==, or > if this Card is <, ==, or > otherCard
		return this.value() - otherCard.value();
	}
}
